<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*
                                                测试题1:  先执行变量提升, 再执行函数提升
                                                  */
        function a() {}
        var a
        console.log(typeof a) // 'function'

        /*
        测试题2:
        */

        if (!(b in window)) {
            var b = 1
        }
        console.log(b) // undefined(说明b在window中，但是没有赋值)--变量提升

        /*
        测试题3:
        */
        var c = 1

        function c(c) {
            console.log(c)
            var c = 3 //与此行无关
        }
        console.log(c);
        c(2) // 报错  c is not a function
    </script>
</body>

</html>